import { createSSRApp } from 'vue'
//@ts-ignore
import uView from './uni_modules/vk-uview-ui'
import './assets/css/font/iconfont.css'
//引入websocket实现方法
// import { StompStarter } from '@/hooks/stomp/StompStarter'
import App from './App.vue'
import store from './store/global'
import { useAmapKeyStore } from './store/modules/amapKey'
import { doGetAmapKey } from './apis/amap'

const amapKeyStore = useAmapKeyStore(store)
doGetAmapKey().then((res) => {
    console.log(res)
    if (res.data) {
        amapKeyStore.SET_ALL_KEY(res.data)
    }
})

export function createApp() {
    const app = createSSRApp(App)
    app.use(store).use(uView)
    // StompStarter.start()
    return {
        app,
    }
}
